package com.abigdreamer.im.client.module.talk.cinema;

import com.abigdreamer.im.client.module.messageProcess.IMessageProcess;
import com.abigdreamer.im.client.module.talk.TalkWindow;
import com.abigdreamer.im.client.module.vo.Cache;
import com.abigdreamer.im.client.util.EIMLogger;
import com.abigdreamer.im.message.BaseMessage;
import com.abigdreamer.im.message.CinemaRequestMessage;

public class CinemaRequestProcess implements IMessageProcess {

	public void processMessage(BaseMessage message) {

		final CinemaRequestMessage requestMessage = (CinemaRequestMessage) message;
		EIMLogger.INFO(message);
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				String friendQQ = requestMessage.getSrcQQ();
				//String owerQQ = requestMessage.getDestQQ();
				Cache cache = Cache.getInstance();
				TalkWindow qqTalkFrame = cache.getTalkFrame(friendQQ);
				qqTalkFrame.addcinemaJPanel("get");
				if (!qqTalkFrame.isVisible()) {
					qqTalkFrame.setVisible(true);
				}
				CinemaIPPort cinemaIPPortBean = new CinemaIPPort();

				cinemaIPPortBean.setSendMediaIP(requestMessage.getSendCinemaDataIP());
				qqTalkFrame.setCinemaIPPortBean(cinemaIPPortBean);

				EIMLogger.Error("SendCinemaDataIP:" + requestMessage.getSendCinemaDataIP());
				EIMLogger.Error("CinemaDataPort:" + requestMessage.getSendCinemaDataPort());
			}
		});

	}

}
